﻿using System;
using System.Linq;
using System.Collections.Generic;
using System.Text;

namespace Microsoft.Practices.Composite.Presentation.Events
{
    public class DefaultDispatcherNetCF : IDispatcherFacade
    {
        #region Fields
        // Helper for marshalling execution to GUI thread
        private System.Windows.Forms.Control mGuiMarshaller;
        #endregion

		/// <summary>
        /// Initializes a new instance of the DefaultDispatcherNetCF class.
		/// </summary>
        public DefaultDispatcherNetCF()
            : base()
        {			
			mGuiMarshaller = new System.Windows.Forms.Control();
            IntPtr handle = mGuiMarshaller.Handle; // Forces creation of window handle
		}

        #region IDispatcherFacade Members

        public void BeginInvoke(Delegate method, object arg)
        {
            mGuiMarshaller.BeginInvoke(method, arg);
        }

        #endregion
    }
}
